<template>
  <div class="show-toast" v-if="isShow">
    <img ref="img" :src="require(typ=='success'?'@/assets/success.svg':'@/assets/fail.svg')" alt="">
    <p>{{txt}}</p>
  </div>
</template>

<script>
  export default {
    props:['type','text'],
    data() {
      return {
        imgList:{
          success:'@/assets/success.svg',
          fail:'@/assets/fail.svg'
        },
        isShow:0,
        txt:this.text,
        typ:this.type
      }
    },
  }
</script>

<style scoped>
.show-toast{
  top: 50%; 
  left: 50%;
  transform: translate(-50%,-50%);
  position: fixed;
  display: flex;
  width: 150px;
  height: 150px;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 600;
  justify-content: center;
  align-items: center;
  flex-flow: column;
  border-radius: 10px;
} 
.show-toast img{
  width: 40%;
}
.show-toast p{
  font-size: 18px;
  color: #fff;
  margin-top: 10px;
}
</style>